package ca.skygazer.shared.coords;

import java.io.Serializable;

@SuppressWarnings("serial")
public class XYCoord implements Serializable {
	public double x=0;
	public double y=0;
	
	public XYCoord(){
	}
	public XYCoord(double x, double y){
		this.x=x;
		this.y=y;
	}
	public XYCoord translate(XYCoord trans){
		this.x=this.x+trans.x;
		this.y=this.y+trans.y;
		return this;
	}
	public XYCoord scale(double scale){
		this.x=this.x*scale;
		this.y=this.y*scale;
		return this;
	}
	public XYCoord copy(){
		return new XYCoord(x,y);
	}
	public double distance(XYCoord xy){
		return Math.sqrt(Math.pow(xy.x-x, 2)+Math.pow(xy.y-y, 2));
	}
}
